home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3n / secure_rpc.z / secure_rpc
Encoding:
Text File  |  1998-10-20  |  20.8 KB  |  265 lines

  1.  
  2.  
  3.  
  4. sssseeeeccccuuuurrrreeee____rrrrppppcccc((((3333NNNN))))                                                  sssseeeeccccuuuurrrreeee____rrrrppppcccc((((3333NNNN))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_eeee_cccc_uuuu_rrrr_eeee______rrrr_pppp_cccc:  _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______ssss_eeee_cccc_cccc_rrrr_eeee_aaaa_tttt_eeee, _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______gggg_eeee_tttt_uuuu_cccc_rrrr_eeee_dddd, _gggg_eeee_tttt_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee,
  10.      _hhhh_oooo_ssss_tttt_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee, _kkkk_eeee_yyyy______dddd_eeee_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn, _kkkk_eeee_yyyy______eeee_nnnn_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn, _kkkk_eeee_yyyy______gggg_eeee_nnnn_dddd_eeee_ssss,
  11.      _kkkk_eeee_yyyy______ssss_eeee_tttt_ssss_eeee_cccc_rrrr_eeee_tttt, _nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_2222_hhhh_oooo_ssss_tttt, _nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_2222_uuuu_ssss_eeee_rrrr, _uuuu_ssss_eeee_rrrr_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee - library
  12.      routines for secure remote procedure calls
  13.  
  14. NNNNOOOOTTTTEEEE
  15.      IRIX does not support DES encryption, so the _AAAA_UUUU_TTTT_HHHH______DDDD_EEEE_SSSS authentication
  16.      discussed here and the various encryption routines are not functional.
  17.      These routines are not present in libc.  Stubs are provided as part of
  18.      libnsl to allow linking of programs, but they return an error condition,
  19.      DESERR_NONE, if invoked.
  20.  
  21. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  22.      RPC library routines allow C programs to make procedure calls on other
  23.      machines across the network.  First, the client calls a procedure to send
  24.      a data packet to the server.  Upon receipt of the packet, the server
  25.      calls a dispatch routine to perform the requested service, and then sends
  26.      back a reply.
  27.  
  28.      RPC supports various authentication flavors.  Among them are:
  29.  
  30.           _AAAA_UUUU_TTTT_HHHH______NNNN_OOOO_NNNN_EEEE      (none)  no authentication.
  31.           _AAAA_UUUU_TTTT_HHHH______SSSS_YYYY_SSSS       Traditional UNIXr-style authentication.
  32.           _AAAA_UUUU_TTTT_HHHH______DDDD_EEEE_SSSS       DES encryption-based authentication.
  33.  
  34.      The _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______gggg_eeee_tttt_uuuu_cccc_rrrr_eeee_dddd and _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______ssss_eeee_cccc_cccc_rrrr_eeee_aaaa_tttt_eeee routines implement the
  35.      _AAAA_UUUU_TTTT_HHHH______DDDD_EEEE_SSSS authentication flavor.  The keyserver daemon _kkkk_eeee_yyyy_ssss_eeee_rrrr_vvvv [see
  36.      _kkkk_eeee_yyyy_ssss_eeee_rrrr_vvvv(1M)] must be running for the _AAAA_UUUU_TTTT_HHHH______DDDD_EEEE_SSSS authentication system to
  37.      work.
  38.  
  39.    RRRRoooouuuuttttiiiinnnneeeessss
  40.      See _rrrr_pppp_cccc(3N) for the definition of the _AAAA_UUUU_TTTT_HHHH data structure.
  41.  
  42.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_rrrr_pppp_cccc_////_rrrr_pppp_cccc_...._hhhh_>>>>
  43.  
  44.      _iiii_nnnn_tttt
  45.      _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______gggg_eeee_tttt_uuuu_cccc_rrrr_eeee_dddd_((((_cccc_oooo_nnnn_ssss_tttt _ssss_tttt_rrrr_uuuu_cccc_tttt _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______cccc_rrrr_eeee_dddd _****_aaaa_dddd_cccc_,,,, _uuuu_iiii_dddd______tttt _****_uuuu_iiii_dddd_pppp_,,,,
  46.           _gggg_iiii_dddd______tttt _****_gggg_iiii_dddd_pppp_,,,, _ssss_hhhh_oooo_rrrr_tttt _****_gggg_iiii_dddd_llll_eeee_nnnn_pppp_,,,, _gggg_iiii_dddd______tttt _****_gggg_iiii_dddd_llll_iiii_ssss_tttt_))))_;;;;
  47.  
  48.           _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______gggg_eeee_tttt_uuuu_cccc_rrrr_eeee_dddd is the first of the two routines which interface to
  49.           the RPC secure authentication system known as _AAAA_UUUU_TTTT_HHHH______DDDD_EEEE_SSSS.  The second
  50.           is _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______ssss_eeee_cccc_cccc_rrrr_eeee_aaaa_tttt_eeee, below.  _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______gggg_eeee_tttt_uuuu_cccc_rrrr_eeee_dddd is used on the server
  51.           side for converting an _AAAA_UUUU_TTTT_HHHH______DDDD_EEEE_SSSS credential, which is operating
  52.           system independent, into an _AAAA_UUUU_TTTT_HHHH______SSSS_YYYY_SSSS credential.  This routine
  53.           returns _1111 if it succeeds, _0000 if it fails.
  54.  
  55.           _****_u_i_d_p is set to the user's numerical ID associated with _a_d_c.  _****_g_i_d_p
  56.           is set to the numerical ID of the group to which the user belongs.
  57.           _****_g_i_d_l_i_s_t contains the numerical IDs of the other groups to which the
  58.           user belongs.  _****_g_i_d_l_e_n_p is set to the number of valid group ID
  59.           entries in _****_g_i_d_l_i_s_t [see _nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_2222_uuuu_ssss_eeee_rrrr, below].
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. sssseeeeccccuuuurrrreeee____rrrrppppcccc((((3333NNNN))))                                                  sssseeeeccccuuuurrrreeee____rrrrppppcccc((((3333NNNN))))
  71.  
  72.  
  73.  
  74.      _AAAA_UUUU_TTTT_HHHH _****
  75.      _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______ssss_eeee_cccc_cccc_rrrr_eeee_aaaa_tttt_eeee_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_nnnn_aaaa_mmmm_eeee_,,,, _cccc_oooo_nnnn_ssss_tttt _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _iiii_nnnn_tttt _wwww_iiii_nnnn_dddd_oooo_wwww_,,,,
  76.           _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_tttt_iiii_mmmm_eeee_hhhh_oooo_ssss_tttt_,,,, _cccc_oooo_nnnn_ssss_tttt _dddd_eeee_ssss______bbbb_llll_oooo_cccc_kkkk _****_cccc_kkkk_eeee_yyyy_))))_;;;;
  77.  
  78.           _aaaa_uuuu_tttt_hhhh_dddd_eeee_ssss______ssss_eeee_cccc_cccc_rrrr_eeee_aaaa_tttt_eeee, the second of two _AAAA_UUUU_TTTT_HHHH______DDDD_EEEE_SSSS authentication
  79.           routines, is used on the client side to return an authentication
  80.           handle that will enable the use of the secure authentication system.
  81.           The first parameter _n_a_m_e is the network name, or _n_e_t_n_a_m_e, of the
  82.           owner of the server process. This field usually represents a
  83.           hostname derived from the utility routine _hhhh_oooo_ssss_tttt_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee, but could
  84.           also represent a user name using _uuuu_ssss_eeee_rrrr_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee, described below.  The
  85.           second field is window on the validity of the client credential,
  86.           given in seconds. A small window is more secure than a large one,
  87.           but choosing too small of a window will increase the frequency of
  88.           resynchronizations because of clock drift. The third parameter,
  89.           _t_i_m_e_h_o_s_t, the host's name, is optional. If it is _NNNN_UUUU_LLLL_LLLL, then the
  90.           authentication system will assume that the local clock is always in
  91.           sync with the _t_i_m_e_h_o_s_t clock, and will not attempt
  92.           resynchronizations.  If a timehost is supplied, however, then the
  93.           system will consult with the remote time service whenever
  94.           resynchronization is required. This parameter is usually the name of
  95.           the RPC server itself.  The final parameter _c_k_e_y is also optional.
  96.           If it is _NNNN_UUUU_LLLL_LLLL, then the authentication system will generate a random
  97.           DES key to be used for the encryption of credentials.  If _c_k_e_y is
  98.           supplied, then it will be used instead.
  99.  
  100.      _iiii_nnnn_tttt
  101.      _gggg_eeee_tttt_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_((((_cccc_hhhh_aaaa_rrrr _nnnn_aaaa_mmmm_eeee_[[[[_MMMM_AAAA_XXXX_NNNN_EEEE_TTTT_NNNN_AAAA_MMMM_EEEE_LLLL_EEEE_NNNN_++++_1111_]]]]_))))_;;;;
  102.  
  103.           _gggg_eeee_tttt_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee installs the unique, operating-system independent netname
  104.           of the caller in the fixed-length array _n_a_m_e.  Returns _1111 if it
  105.           succeeds, and _0000 if it fails.
  106.  
  107.      _iiii_nnnn_tttt
  108.      _hhhh_oooo_ssss_tttt_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_((((_cccc_hhhh_aaaa_rrrr _nnnn_aaaa_mmmm_eeee_[[[[_MMMM_AAAA_XXXX_NNNN_EEEE_TTTT_NNNN_AAAA_MMMM_EEEE_LLLL_EEEE_NNNN_++++_1111_]]]]_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_hhhh_oooo_ssss_tttt_,,,,
  109.           _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_dddd_oooo_mmmm_aaaa_iiii_nnnn_))))_;;;;
  110.  
  111.           Convert from a domain-specific hostname _h_o_s_t to an operating-system
  112.           independent netname.  Return _1111 if it succeeds, and _0000 if it fails.
  113.           Inverse of _nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_2222_hhhh_oooo_ssss_tttt.  If _d_o_m_a_i_n is _NNNN_UUUU_LLLL_LLLL, _hhhh_oooo_ssss_tttt_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee uses the
  114.           default domain name of the machine. If _h_o_s_t is _NNNN_UUUU_LLLL_LLLL, it defaults to
  115.           that machine itself.
  116.  
  117.      _iiii_nnnn_tttt
  118.      _kkkk_eeee_yyyy______dddd_eeee_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_rrrr_eeee_mmmm_oooo_tttt_eeee_nnnn_aaaa_mmmm_eeee_,,,, _dddd_eeee_ssss______bbbb_llll_oooo_cccc_kkkk _****_dddd_eeee_ssss_kkkk_eeee_yyyy_))))_;;;;
  119.  
  120.           _kkkk_eeee_yyyy______dddd_eeee_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn is an interface to the keyserver daemon, which is
  121.           associated with RPC's secure authentication system (_AAAA_UUUU_TTTT_HHHH______DDDD_EEEE_SSSS
  122.           authentication).  User programs rarely need to call it, or its
  123.           associated routines _kkkk_eeee_yyyy______eeee_nnnn_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn, _kkkk_eeee_yyyy______gggg_eeee_nnnn_dddd_eeee_ssss and
  124.           _kkkk_eeee_yyyy______ssss_eeee_tttt_ssss_eeee_cccc_rrrr_eeee_tttt.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. sssseeeeccccuuuurrrreeee____rrrrppppcccc((((3333NNNN))))                                                  sssseeeeccccuuuurrrreeee____rrrrppppcccc((((3333NNNN))))
  137.  
  138.  
  139.  
  140.           _kkkk_eeee_yyyy______dddd_eeee_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn takes a server netname _r_e_m_o_t_e_n_a_m_e and a DES key
  141.           _d_e_s_k_e_y, and decrypts the key by using the public key of the the
  142.           server and the secret key associated with the effective UID of the
  143.           calling process. It is the inverse of _kkkk_eeee_yyyy______eeee_nnnn_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn.
  144.  
  145.      _iiii_nnnn_tttt
  146.      _kkkk_eeee_yyyy______eeee_nnnn_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_rrrr_eeee_mmmm_oooo_tttt_eeee_nnnn_aaaa_mmmm_eeee_,,,, _dddd_eeee_ssss______bbbb_llll_oooo_cccc_kkkk _****_dddd_eeee_ssss_kkkk_eeee_yyyy_))))_;;;;
  147.  
  148.           _kkkk_eeee_yyyy______eeee_nnnn_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn is a keyserver interface routine. It takes a
  149.           server netname _r_e_m_o_t_e_n_a_m_e and a DES key _d_e_s_k_e_y, and encrypts it
  150.           using the public key of the server and the secret key associated
  151.           with the effective UID of the calling process. It is the inverse of
  152.           _kkkk_eeee_yyyy______dddd_eeee_cccc_rrrr_yyyy_pppp_tttt_ssss_eeee_ssss_ssss_iiii_oooo_nnnn.  This routine returns _0000 if it succeeds, _----_1111 if it
  153.           fails.
  154.  
  155.      _iiii_nnnn_tttt
  156.      _kkkk_eeee_yyyy______gggg_eeee_nnnn_dddd_eeee_ssss_((((_dddd_eeee_ssss______bbbb_llll_oooo_cccc_kkkk _****_dddd_eeee_ssss_kkkk_eeee_yyyy_))))_;;;;
  157.  
  158.           _kkkk_eeee_yyyy______gggg_eeee_nnnn_dddd_eeee_ssss is a keyserver interface routine. It is used to ask the
  159.           keyserver for a secure conversation key.  Choosing one at random is
  160.           usually not good enough, because the common ways of choosing random
  161.           numbers, such as using the current time, are very easy to guess.
  162.  
  163.      _iiii_nnnn_tttt
  164.      _kkkk_eeee_yyyy______ssss_eeee_tttt_ssss_eeee_cccc_rrrr_eeee_tttt_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_kkkk_eeee_yyyy_))))_;;;;
  165.  
  166.           _kkkk_eeee_yyyy______ssss_eeee_tttt_ssss_eeee_cccc_rrrr_eeee_tttt is a keyserver interface routine. It is used to set
  167.           the key for the effective UID of the calling process.  this routine
  168.           returns _0000 if it succeeds, _----_1111 if it fails.
  169.  
  170.      _iiii_nnnn_tttt
  171.      _nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_2222_hhhh_oooo_ssss_tttt_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_nnnn_aaaa_mmmm_eeee_,,,, _cccc_hhhh_aaaa_rrrr _****_hhhh_oooo_ssss_tttt_,,,, _cccc_oooo_nnnn_ssss_tttt _iiii_nnnn_tttt _hhhh_oooo_ssss_tttt_llll_eeee_nnnn_))))_;;;;
  172.  
  173.           Convert from an operating-system independent netname _n_a_m_e to a
  174.           domain-specific hostname _h_o_s_t.  _h_o_s_t_l_e_n is the maximum size of _h_o_s_t.
  175.           Returns _1111 if it succeeds, and _0000 if it fails.  Inverse of
  176.           _hhhh_oooo_ssss_tttt_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee.
  177.  
  178.      _iiii_nnnn_tttt
  179.      _nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_2222_uuuu_ssss_eeee_rrrr_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_nnnn_aaaa_mmmm_eeee_,,,, _uuuu_iiii_dddd______tttt _****_uuuu_iiii_dddd_pppp_,,,, _gggg_iiii_dddd______tttt _****_gggg_iiii_dddd_pppp_,,,,
  180.           _iiii_nnnn_tttt _****_gggg_iiii_dddd_llll_eeee_nnnn_pppp_,,,, _gggg_iiii_dddd______tttt _gggg_iiii_dddd_llll_iiii_ssss_tttt_[[[[_NNNN_GGGG_RRRR_OOOO_UUUU_PPPP_SSSS_]]]]_))))_;;;;
  181.  
  182.           Convert from an operating-system independent netname to a domain-
  183.           specific user ID.  Returns _1111 if it succeeds, and _0000 if it fails.
  184.           Inverse of _uuuu_ssss_eeee_rrrr_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee.
  185.  
  186.           _****_u_i_d_p is set to the user's numerical ID associated with _n_a_m_e.  _****_g_i_d_p
  187.           is set to the numerical ID of the group to which the user belongs.
  188.           _g_i_d_l_i_s_t contains the numerical IDs of the other groups to which the
  189.           user belongs.  _****_g_i_d_l_e_n_p is set to the number of valid group ID
  190.           entries in _g_i_d_l_i_s_t.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. sssseeeeccccuuuurrrreeee____rrrrppppcccc((((3333NNNN))))                                                  sssseeeeccccuuuurrrreeee____rrrrppppcccc((((3333NNNN))))
  203.  
  204.  
  205.  
  206.      _iiii_nnnn_tttt
  207.      _uuuu_ssss_eeee_rrrr_2222_nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_((((_cccc_hhhh_aaaa_rrrr _nnnn_aaaa_mmmm_eeee_[[[[_MMMM_AAAA_XXXX_NNNN_EEEE_TTTT_NNNN_AAAA_MMMM_EEEE_LLLL_EEEE_NNNN_++++_1111_]]]]_,,,, _uuuu_iiii_dddd______tttt _uuuu_iiii_dddd_,,,,
  208.           _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_dddd_oooo_mmmm_aaaa_iiii_nnnn_))))_;;;;
  209.  
  210.           Convert from a domain-specific username to an operating-system
  211.           independent netname.  Returns _1111 if it succeeds, and _0000 if it fails.
  212.           Inverse of _nnnn_eeee_tttt_nnnn_aaaa_mmmm_eeee_2222_uuuu_ssss_eeee_rrrr.
  213.  
  214. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  215.      _rrrr_pppp_cccc(3N), _rrrr_pppp_cccc______cccc_llll_nnnn_tttt______aaaa_uuuu_tttt_hhhh(3N)
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.